import React from 'react'
import ReactDOM from 'react-dom'   
import  PTrees from '../../component/Trees/Trees'//Trees
import './css/TreesDemo.css' 
 
class TreesDemo extends React.Component {
    constructor(props) {
        super(props);
        this.state = { 
            legend : false , 
        };
    }
    info={
        btn:{
              height: 60,
              lineHeight:'60px'
        }
    } 
     resume = ()=>{//第一次不执行，每次跳转进来会执行
        let par =[];
        let obj=document.getElementsByTagName('input');
        for (let i=0;i<obj.length;i++){ //默认不选择
           obj[i].checked = false
        } 
    }

    treesConfig = {
        width:  350,
        height:(document.documentElement.clientHeight || document.body.clientHeight)-this.info.btn.height-38,
        theme:'default',  
        key:'role_list' ,//节点树的数据
        checkbox:true,//复选框
        childThreeOpen:false,//默认关闭三级子节点
        icon:'./assets/Trees/json-down.png',//图标
        imgStyle:{ width: 15,  height: 15,   opacity: .85 , position: 'relative',  left: '-10px' },
        checkData:[], 
    } 
    treesData=[   ]   
    saveFn = ()=>{ 
        let par =[];//选中的
        let obj=document.getElementsByTagName('input');
        for (let i=0;i<obj.length;i++){ 
            if(obj[i].checked){
                par.push(obj[i].getAttribute('data-origin_id'))
            } 
        } 
    }

    componentWillMount = () => {   } 
    componentDidMount = () => {  } 
  
 

    render() {
        
        return (
            <div  className="PTreesDemo"> 
                  <PTrees  treesConfig={this.treesConfig}  treesData={this.treesData}   ></PTrees> 
            </div>
        )
    }
} 
export default TreesDemo 